//
//  KRRecipeListCell.m
//  cookBook
//
//  Created by kuroken on 16/1/10.
//  Copyright © 2016年 kuroken. All rights reserved.
//

#import "KRRecipeListCell.h"
#import "KRRecipeList.h"
#import <UIImageView+WebCache.h>
#import "KRConst.h"

@interface KRRecipeListCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLable;

@end

@implementation KRRecipeListCell

- (void)setRecipeList:(KRRecipeList *)recipeList
{
    _recipeList = recipeList;

    [self.titleLable setText:[NSString stringWithFormat:@"  %@  ", recipeList.title]];
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:recipeList.img] placeholderImage:[UIImage imageNamed:@"default_r640-400"]];
}


- (void)awakeFromNib {
    
    self.imageView.contentMode = UIViewContentModeScaleAspectFill;

    self.titleLable.backgroundColor = KRColorWithAlpha(236, 114, 55, 0.8);
    self.titleLable.textColor = [UIColor whiteColor];
    // 切圆角
    self.titleLable.layer.cornerRadius = self.titleLable.frame.size.height * 0.5;
    self.titleLable.clipsToBounds = YES;
}

@end
